/**
 * 头部导航
 * NAV
 */

header {
    height: 80px;
}

#logo {
    height: 40px;
    padding-top: 10px;
}

#nav {
    $height: 80px;
    margin-bottom: 0;
    background-color: #fff;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    .navbar-nav {
        background: #FFFFFF;
        a,
        a:hover,
        a:active,
        a:focus {
            color: #858585;
            text-decoration: none;
        }
        >li {
            //一级目录
            font-size: 16px;
            color: #858585;
            position: relative;
            &:after {
                position: absolute;
                right: 0;
                top: 50%;
                transform: translate(0, -50%, );
                content: '';
                display: block;
                height: 7px;
                width: 1px;
                background: #858585;
            }
            a {
                padding: 0;
            }
            >a>span {
                height: $height;
                line-height: $height;
                padding: 0 48px;
                display: block;
                &:hover{
                    color: $color-primary;
                }
            }
            &.active>a {
                color: $color-primary;
                background: none;
            }
        }
    }
    #nav-search {
        height: $height;
        display: block;
        #showSearch{
            display: none;
            &.show{
                display: block;
            }
        }
        .search {
            padding-top: 14px;
        }
        &:after {
            display: none;
        }
        .search-icon {
            padding-left: 100px;
            padding-right: 40px;
        }
    }
    #nav-lang {
        height: $height;
        text-align: center;
        .lang {
            margin-top: 28px;
        }
        &:after {
            display: none;
        }
    }
}

.nav_cover{
    position: fixed;width: 100%;height: 100%;background: rgba(0,0,0,0.5);
    z-index: 5;
}

@media screen and (min-width: 767px) and (max-width: 2000px) {
    .nav-li {
        >ul {
            //二级目录
            display: none;
            position: absolute;
            top: 78px;
            left: 0px;
            background-color: #fff;
            border-top: 2px solid $color-primary-bg;
            padding: 20px 0;
            width: 100%;
            &:after {
                content: '';
                display: block;
                width: 0;
                height: 0;
                border: 6px solid transparent;
                border-bottom-color: $color-primary-bg;
                position: absolute;
                top: -12px;
                left: 58px;
            }
            >li {
                padding-left: 36px;
                span {
                    height: 32px;
                    line-height: 32px;
                    display: inline-block;
                    position: relative;
                    font-size: 12px;
                    padding: 0 !important;
                    .icon {
                        position: absolute;
                        right: -20px;
                        top: 10px;
                        color: $color-primary;
                        font-size: 12px;
                    }
                }
                >ul {
                    //三级目录
                    display: none;
                    position: absolute;
                    top: -2px;
                    left: 105px;
                    width: 90px;
                    background-color: #fff;
                    border-top: 2px solid $color-primary-bg;
                    padding: 20px 0;
                    display: none;
                    li{
                        text-align: center;
                    }
                }
                &.active>a>span,
                >ul>li:hover>a>span {
                    color: $color-primary;
                    &:after {
                        position: absolute;
                        bottom: 0;
                        left: 0;
                        content: '';
                        display: block;
                        background: $color-primary-bg;
                        height: 1px;
                        width: 48px;
                    }
                }
                &.active {
                    ul {
                        display: block;
                    }
                }
            }
        }
        &.hover>ul {
            display: block;
        }
    }
}

@media screen and (min-width: 767px) and (max-width: 1000px) {
    .nav-li>ul>li {
        padding-left: 26px !important;
        >ul {
            left: 100px !important;
        }
    }
}

@media screen and (max-width: 1000px) {
    #nav {
        .navbar-nav>li a>span {
            padding: 0 40px;
        }
        #nav-search {
            .search-icon {
                padding-left: 40px;
            }
        }
        .search-input input {
            width: 300px;
        }
    }
}

// 移动端模式
@media screen and (max-width: 767px) {
    header {
        height: 50px;
    }
    .nav-li {
        >ul {
            // 二级
            display: none;
            >li {
                span .icon {
                    color: $color-primary;
                    transition: all .5s;
                }
                >ul {
                    // 三级
                    display: none;
                    padding-left: 20px;
                    background-color: #fff;
                    >li {
                        border-bottom: 1px solid #eee;
                        span { color: $color-primary; }
                    }
                }
            }
        }
        &.hover>a>span {
            background-color: #eee;
            color: $color-primary;
        }
        &.hover>ul {
            display: block;
        }
        >ul>li.active>a>span {
            .icon {
                transform: rotate(90deg);
            }
            color: $color-primary;
        }
        >ul>li.active>ul {
            display: block;
        }
    }
    #nav {
        $height: 50px;
        .navbar-nav>li {
            border-bottom: 1px solid #eee;
            a>span {
                height: $height;
                line-height: $height;
            }
            &:after {
                display: none;
            }
        }
        #nav-lang {
            height: $height;
            .lang {
                margin-top: 12px;
                a {
                    width: 80px;
                }
            }
        }
        #nav-search {
            height: auto;
            text-align: center;
            .search {
                padding-top: 0px;
                >span {
                    display: block;
                    text-align: center;
                    margin: 8px 0;
                    width: 100%;
                }
                .search-input input {
                    width: 90%;
                }
            }
        }
    }
    .navbar-brand {
        padding-top: 0;
    }
}

.search {
    >span {
        vertical-align: middle;
    }
    .search-close em {
        height: 50px;
        width: 50px;
        background-color: #f1f1f1;
        border-radius: 50%;
        display: inline-block;
        text-align: center;
        .icon {
            color: #575757;
            line-height: 50px;
            font-size: 18px;
        }
    }
    .search-input input {
        height: 30px;
        width: 290px;
        padding: 0 20px;
        background-color: #f1f1f1;
        line-height: 30px;
        border: none;
        color: #000;margin-left:20px;
    }
    .search-icon,
    .search-btn {
        height: 50px;
        width: 50px;
        line-height: 50px;
        font-size: 18px;
        text-align: center;
        display: inline-block;
        .icon {
            color: #575757;
            line-height: 50px;
            font-size: 18px;
        }
    }
    .search-btn .icon{
        color: $color-primary;
    }
}

// 语言切换
.lang {
    @include clearfix;
    display: inline-block;
    a {
        display: inline-block;
        width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 14px;
        text-align: center;
        color: #8c8c8c;vertical-align: mmiddle;
        &:first-child {
            border-right: none;
        }
        &:hover,
        &:focus {
            text-decoration: none;color: #000!important;
        }
        &.active {
            color: #000!important;font-weight: normal;
        }
    }
    span{
        height: 6px;width:1px;background: #8c8c8c;display: inline-block;
        vertical-align: middle;
    }
}
